package scjp.preparation.io;

import java.io.BufferedWriter;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.nio.file.Files;
import java.nio.file.NoSuchFileException;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.nio.file.attribute.BasicFileAttributes;

public class Test {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		String file1 = "C:\\Temp\\a\\b";
		String file2 = "C:\\a\\..\\temp\\a\\b\\temp.txt";
		String file3 = "C:\\Temp\\A\\b\\temp.txt";
		Path path1 = Paths.get(file1);
		Path path2 = Paths.get(file2);
		Path path3 = Paths.get(file3);
		
		Path f = path1.resolve("temp.txt");
		System.out.println(f);
		try{
			BasicFileAttributes basicFilesAttr = Files.readAttributes(f, BasicFileAttributes.class);
//			System.out.println(basicFilesAttr.isDirectory());
		}
		catch(NoSuchFileException e1) {
			System.out.println(e1);
		}
		catch(IOException e) {
			System.out.println(e);
		}

	}

}
